package br.edu.granbery.indianostore.action;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import br.edu.granbery.indianostore.controller.Action;

public class LogoffAction implements Action{

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		HttpSession session = request.getSession(true);
		session.removeAttribute("User");
		RequestDispatcher view = request.getRequestDispatcher("/View/Login/Login.jsp");
		try {
			view.forward(request, response);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
